package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_order_detail;

//DAO
public interface T_order_detailMapperBase {

	// 根据id查看
	@Select("SELECT * FROM T_ORDER_DETAIL  WHERE ID = #{id}")
	public ApiT_order_detail findT_order_detailById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_order_detail")
	public List<ApiT_order_detail> findT_order_details();

	// 根据条件查看数据集
	public List<Map<String, Object>> findT_order_detailsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO T_ORDER_DETAIL (DID, MONEY, NUM, PRODUCT_ID,POINTS, EXT_1, EXT_2, EXT_3, EXT_4, EXT_5) VALUES (#{did}, #{money}, #{num}, #{product_id},#{points}, #{ext_1}, #{ext_2}, #{ext_3}, #{ext_4}, #{ext_5})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_order_detail(ApiT_order_detail t_order_detail);

	// 修改
	@Update("UPDATE T_ORDER_DETAIL SET DID = #{did}, MONEY = #{money}, NUM = #{num}, PRODUCT_ID = #{product_id},target_ID = #{target_id},  POINTS = #{points}, EXT_1 = #{ext_1}, EXT_2 = #{ext_2}, EXT_3 = #{ext_3}, EXT_4 = #{ext_4}, EXT_5 = #{ext_5} WHERE ID = #{id}")
	public int updateT_order_detail(ApiT_order_detail t_order_detail);

	// 删除
	@Delete("DELETE FROM T_ORDER_DETAIL  WHERE ID = #{id}")
	public int deleteT_order_detail(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
